<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>忘记密码？？？</title>
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <style>
        input {
            width: 230px;
            height: 50px;
            font-size: 20px;
            margin-bottom: 25px;
        }
        button {
            width: 70px;
            height: 30px;
            color: #13ce66;
            background-color: #ffffff;
            border: 1px solid #13ce66;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div id="app">
    <div style="height: 60px; text-align: center">
        <h2 style="line-height: 60px;">忘记密码</h2>
    </div>
    <form :model="customer" style="border: 4px solid #7fce67; width: 400px; height: 300px; margin: 50px auto; padding: 40px;">
        用户名：<input v-model="customer.name"><br>
        密码：&nbsp;&nbsp;&nbsp;<input v-model="customer.password">
        <button type="submit" @click="updateP()">确认修改</button>
    </form>
</div>
</body>

<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            customer: [],
        },
        methods: {
            updateP(){
                var _this = this;
                axios({
                    method: "post",
                    url: "http://localhost:8080/customer/updateP",
                    data: _this.customer
                }).then(function (resp) {
                    //如果操作成功，关闭弹窗，刷新数据
                    //console.log(resp.data);
                    if(resp.data.code === 20041){    //成功
                        _this.$message.success(resp.data.msg);
                    }else if(resp.data.code === 20040){     //失败
                        _this.$message.error(resp.data.msg);
                    }else {
                        _this.$message.error(resp.data.msg);
                    }
                })
            },
            //
        },
    })
</script>

</html>